﻿using LPPA.Facturacion.BusinessLayer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LPPA.Facturacion.UI.Views.Facturacion
{
    public partial class Factura1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["Id"] == null)
                return;

            var facturaId = Request.QueryString["Id"].ToString();

            var factura = FacturaService.GetById(Convert.ToInt32(facturaId));

            lblFecha.Text = factura.Fecha.ToString();
            
            lblFacturaNro.Text = factura.NumeroFactura.ToString();
            lblMontoTotal.Text = factura.MontoTotal.ToString();
            lblTitular.Text = factura.Titular.Nombre;

            rptDetalle.DataSource = factura.DetalleFactura;
            rptDetalle.DataBind();
        }
    }
}